﻿namespace Common.MQ
{
    /// <summary>
    /// 消息接口
    /// </summary>
    public interface IMessageModel
    {
        /// <summary>
        /// 发送目的地
        /// </summary>
        string GetDestination();
        /// <summary>
        /// 获取消息json
        /// </summary>
        /// <returns></returns>
        string GetMessageJson();
        /// <summary>
        /// 获取消息属性
        /// </summary>
        /// <returns></returns>
        MessageProperty GetProperties();
        /// <summary>
        /// 获取消息类型
        /// </summary>
        /// <returns></returns>
        string GetMessageType();
    }
    /// <summary>
    /// 消息属性
    /// </summary>
    public class MessageProperty
    {
        /// <summary>
        /// 消息的过期时间，超过此时间未被消费，将执行过期策略，或删除或重发
        /// </summary>
        public long TimeoutSeconds { get; set; }
    }
}